<?php
/**
 *
 * @author Griever
 * @version 
 */
require_once 'Base.php';
/**
 * CheckPairedValue Action Helper 
 * 
 * @uses actionHelper Custom_Helper
 */
class Custom_Helper_CheckPairedValue extends Dummy_Helper_Base {

	public function checkPairedValue($paramA, $paramB) {
		if ($this->hasInputParam ( $paramA )) {
			$p1 = $this->getRequest ()
				->getParam ( $paramA );
			if ($this->hasInputParam ( $paramB )) {
				$p2 = $this->getRequest ()
					->getParam ( $paramB );
			} else {
				$p2 = '';
			}
			if ($p1 !== $p2) {
				return false;
			}
		}
		return true;
	}

	/**
	 * Strategy pattern: call helper as broker method
	 */
	public function direct($paramA, $paramB) {
		// TODO Auto-generated 'direct' method
		return $this->checkPairedValue($paramA, $paramB);
	}
}
